home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 19
/
CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso
/
CUCD
/
Readers
/
Gui4Cli
/
Docs
/
Tutorials
/
Clock.gc
< prev
next >
Wrap
Text File
|
1997-12-02
|
2KB
|
81 lines
G4C
; Clock.gc
; ============================================================
; This gui works together with the Clock.rexx Arexx script
; which is also in this directory - You must also read that
; to get the full picture.
; Note that if you really want to implement one or more clocks
; in your guis, you should use the Guis:tools/rtn/Clock.g
; routine - see it's explanation in the Docs/Routines.guide
; ============================================================
WINBIG -1 -1 304 26 'ARexx-Gui4Cli Clock'
BOX 0 0 0 0 out button ; decorative border
; ============================================================
; Upon loading, we make sure that rexxmast is available, then
; we launch the rexx program that will set our variables and
; wake us up every minute, so we can refresh the display.
; ============================================================
xOnLoad
; look for arexx and if not found, launch it..
ifexists port AREXX
; ok..
else
cli 'rexxmast'
wait port AREXX 30
if $$retcode > 0
ezreq 'Could not launch RexxMast!' Quit ''
guiquit clock.gc
stop
endif
endif
; Look for the Clock.rexx program, in the same directory
extract clock.gc guipath path
joinfile $path Clock.rexx rexxprog
; Open the gui and start up the rexx program
GuiOpen Clock.gc
sendrexx AREXX '$rexxprog clock.gc update'
; ============================================================
; On closing the gui, quit. The ARexx program we launched will
; quit on it's own when it wakes up and doesn't find us..
; ============================================================
xOnClose
guiquit Clock.gc
; ============================================================
; This is the gadget that shows the time, date etc
; ============================================================
TEXT 7 5 290 16 "" 100 BOX
gadfont opal.font 12 000 ; change the font here
gadtxt center
gadid 1
; ============================================================
; This is the routine that the rexx program we launched will
; call every minute, after it has set our variables.
; We use it to update the above text gadget.
; ============================================================
XRoutine update
update clock.gc 1 "$time - $day\, $date"